Skip to content

[@mantine/core] Stepper: Make stepper composite#9076

Open
jonjomckay wants to merge 4 commits into
mantinedev:masterfrom
Notify-AI:feat/make-stepper-composite
Open

[@mantine/core] Stepper: Make stepper composite#9076
jonjomckay wants to merge 4 commits into
mantinedev:masterfrom
Notify-AI:feat/make-stepper-composite

Conversation

@jonjomckay

@jonjomckay jonjomckay commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

This refactors @mantine/core's Stepper into a compound component API (Stepper.Root, Stepper.Steps, Stepper.Content, Stepper.Completed) while keeping Stepper as a convenience wrapper, and updates docs/demos/tests accordingly.

This change is backwards-compatible, and all current usages of the Stepper component should continue to work as expected.

Changes:

  • Added new compound components (StepperRoot, StepperSteps, StepperContent) and refactored Stepper to use them.
  • Updated the StepperCompleted component to render the completed content, and added optional context access.
  • Added coverage and documentation for compound usage, plus new demos/stories and docs updates.

This fixes https://github.com/orgs/mantinedev/discussions/8562

Copilot AI review requested due to automatic review settings July 22, 2026 14:44
@jonjomckay
jonjomckay marked this pull request as draft July 22, 2026 14:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors @mantine/core Stepper into a composite/compound component API (Stepper.Root, Stepper.Steps, Stepper.Content, Stepper.Completed) while keeping Stepper as a convenience wrapper, and updates docs/demos/tests accordingly.

Changes:

  • Added new compound components (StepperRoot, StepperSteps, StepperContent) and wired Stepper to render through them.
  • Updated StepperCompleted to render completed content (including keep-mounted behavior) and added optional context access.
  • Added coverage and documentation for compound usage, plus new demos/stories and docgen path updates.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
scripts/docgen/docgen-paths.ts Includes new Stepper compound component files in doc generation inputs
packages/@mantine/core/src/components/Stepper/StepperSteps/StepperSteps.tsx New Stepper.Steps implementation that renders step indicators and separators
packages/@mantine/core/src/components/Stepper/StepperStep/StepperStep.tsx Updates StepFragmentComponent type import to new root module
packages/@mantine/core/src/components/Stepper/StepperRoot/StepperRoot.tsx New Stepper.Root that owns context, styles API, and CSS vars
packages/@mantine/core/src/components/Stepper/StepperContent/StepperContent.tsx New Stepper.Content responsible for per-step content rendering (with keepMounted support)
packages/@mantine/core/src/components/Stepper/StepperCompleted/StepperCompleted.tsx Stepper.Completed now renders completed content based on context + step
packages/@mantine/core/src/components/Stepper/Stepper.tsx Refactors Stepper to be a wrapper over the compound components and exposes them as statics
packages/@mantine/core/src/components/Stepper/Stepper.test.tsx Adds tests for compound components API, SSR, styles API, and click behavior
packages/@mantine/core/src/components/Stepper/Stepper.story.tsx Adds Storybook examples for compound usage, including sticky steps
packages/@mantine/core/src/components/Stepper/Stepper.context.ts Extends Stepper context to include active state, click handler, icons, etc., and adds optional context hook
packages/@mantine/core/src/components/Stepper/index.ts Exports new compound components and their types
packages/@docs/demos/src/demos/core/Stepper/Stepper.demos.story.tsx Registers new docs demos for compound variants
packages/@docs/demos/src/demos/core/Stepper/Stepper.demo.compound.tsx Adds compound components demo snippet
packages/@docs/demos/src/demos/core/Stepper/Stepper.demo.compoundSticky.tsx Adds sticky-steps compound demo snippet
packages/@docs/demos/src/demos/core/Stepper/index.ts Exports new demo entries
apps/mantine.dev/src/pages/core/stepper.mdx Documents compound component usage and includes new demos
apps/mantine.dev/src/mdx/data/mdx-core-data.ts Adds compound components to generated props list for the Stepper page

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/@mantine/core/src/components/Stepper/StepperContent/StepperContent.tsx Outdated
Copilot AI review requested due to automatic review settings July 22, 2026 15:16
@jonjomckay
jonjomckay force-pushed the feat/make-stepper-composite branch from a477945 to 90b9a27 Compare July 22, 2026 15:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

attributes,
...others
} = props;
const props = useProps('Stepper', null, _props);
@jonjomckay
jonjomckay marked this pull request as ready for review July 22, 2026 15:22
Copilot AI review requested due to automatic review settings July 22, 2026 15:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 23, 2026 10:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Comment thread packages/@mantine/core/src/components/Stepper/Stepper.context.ts
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 23, 2026 10:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Comment on lines +76 to +82
cloneElement(item, {
icon: item.props.icon || ctx.icon || index + 1,
key: index,
step: index,
state,
onClick: () => isStepSelectionEnabled && ctx.onStepClick?.(index),
allowStepClick: isStepSelectionEnabled,
Comment on lines +94 to +95
/** Key of `theme.radius` or any valid CSS value to set steps border-radius @default "xl" */
radius?: MantineRadius;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants